import request from '@/utils/request'

// 查询商品销售报表列表
export function getSalesReportList(query) {
  return request({
    url: '/statistics/good_analyse/sale',
    method: 'get',
    params: query
  })
}

// 查询商品销售报表详情
export function getSalesReportDetail(productId) {
  return request({
    url: '/statistics/good_analyse/sale/detail/' + productId,
    method: 'get'
  })
}

// 根据分类ID查询销售报表汇总
export function getSalesReportByCategory(categoryId) {
  return request({
    url: '/statistics/good_analyse/sale/category/' + categoryId,
    method: 'get'
  })
}

// 查询销售报表统计数据
export function getSalesReportStatistics(query) {
  return request({
    url: '/statistics/good_analyse/sale/statistics',
    method: 'get',
    params: query
  })
}

// 导出商品销售报表
export function exportSalesReport(query) {
  return request({
    url: '/statistics/good_analyse/sale/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}